Data Mastery - SQL by Glass Lauren

Data Mastery - SQL by Glass Lauren

Author:Glass, Lauren [Glass, Lauren]
Language: eng
Format: mobi
Published: 2019-03-21T16:00:00+00:00


Let’s introduce a new table, user_revenue:

An INNER JOIN only returns data where the values in the chosen columns match up exactly in both tables. You choose columns with the ON/AND keywords and a condition.

Say we want to see for each user who has played a game their total score and how much they paid our company. Here is the query:

SELECT d.userid, SUM(d.score) AS total_score, r.revenue

FROM daily_user_score AS d

INNER JOIN user_revenue AS r

ON d.userid = r.userid

GROUP BY d.userid, r.revenue;

This query returns:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.